import React from 'react';
import {render} from 'react-dom';
import {Provider} from 'react-redux';
import {createStore, applyMiddleware} from 'redux';
import thunk from 'redux-thunk';
// import rootReducer from './reducer';
// import ConnectContainer from './container/ConnectContainer';

import App from './component/App';

// 1. 创建 store
// let store = createStore(rootReducer, applyMiddleware(thunk));
let store = {};

render(
    <Provider store={ store }>
        <div>
            <App/>
            {/* 其他 container 组件 */}
        </div>
    </Provider>,
    document.querySelector('#root')
);

// console.log('初始 state 状态: ', store.getState());

// 2. 设置监听, state 更新完成后, 监听回调函数执行.
/*
 let unsubscribe = store.subscribe(() => {
 console.log('更新 state 完成, 现在状态: ', store.getState());
 });
*/

// 4. 停止监听
// unsubscribe();
			